<template>
  <div class="life">
      life
      <p @click="addCount">{{count}} </p>
  </div>
</template>

<script>
import { toRefs,reactive,onMounted,onUpdated } from 'vue'
export default {
    setup() {
        const state = reactive({
            count:1,
            addCount(){
                state.count++
            }
        })
        const refState = toRefs(state);
        onMounted(()=>{
            console.log("onMounted");
        })
        onUpdated(()=>{
            console.log("onMUpdate");
        })
        return {
            ...refState
        }
    }
}
</script>

<style>

</style>